﻿using Basic.FlowGatewayModule.Interface;
using Basic.FlowRemoteModel.FlowNode;
using Basic.FlowRemoteModel.FlowNode.Model;

namespace Basic.FlowGatewayModule.lmpl
{
    internal class FlowNodeService : IFlowNodeService
    {
        public long Add ( FlowNodeAdd data )
        {
            return new AddFlowNode
            {
                Datum = data
            }.Send();
        }
        public bool Set ( long id, FlowNodeSet set )
        {
            return new SetFlowNode
            {
                Id = id,
                Datum = set
            }.Send();
        }
        public bool SetIntoOut ( long id, FlowNodeIntoOut datum )
        {
            return new SetFlowNodeIntoOut
            {
                Id = id,
                Datum = datum
            }.Send();
        }
        public void Delete ( long id )
        {
            new DeleteFlowNode
            {
                Id = id
            }.Send();
        }
        public FlowNodeDto Get ( long id )
        {
            return new GetFlowNode
            {
                Id = id
            }.Send();
        }
        public FlowNodeBase[] Gets ( long flowId )
        {
            return new GetFlowNodeList
            {
                FlowId = flowId
            }.Send();
        }

        public void SetCoordinate ( long id, ImgPoint point )
        {
            new SetFlowNodeCoordinate
            {
                Id = id,
                Point = point
            }.Send();
        }

        public bool SetBeginNode ( long id, BeginNodeSet nodeSet )
        {
            return new SetFlowBeginNode
            {
                Id = id,
                Node = nodeSet
            }.Send();
        }

        public bool SetForm ( long id, FlowNodeForm form )
        {
            return new SetFlowNodeForm
            {
                Id = id,
                Form = form
            }.Send();
        }
    }
}
